#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>

int main()
{
	FILE* pr = fopen("data.txt", "r");
	FILE* prcopy = fopen("data_copy.txt", "w");
if (pr == NULL||prcopy==NULL) {
		perror(fopen);
		return EXIT_FAILURE;
	}

int ch;
while ((ch = fgetc(pr)) != EOF) {
	fputc(ch, prcopy);
}

fclose(pr);
fclose(prcopy);
pr = NULL;
prcopy = NULL;

	return 0;
}